
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.YearCollegeDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class YearCollegeDaoJdbc extends BaseDaoJdbc implements YearCollegeDao {
	String tableName="T_YEAR_COLLEGE";
	String beanName="yearCollege";
	
	public CommonBean createYearCollege(){
		CommonBean yearColleges=this.createBean(tableName,beanName);
                return yearColleges;		
	}
	
/*
	public CommonBean findYearColleges(String refid) {
		CommonBean yearColleges=this.createYearCollege();
		String sql="select * from T_YEAR_COLLEGE where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		yearColleges.addData(data);
                return yearColleges;
       }
*/
	public CommonBean findYearCollegeById(String id) {
		CommonBean yearColleges=this.createYearCollege();
		String sql="select * from T_YEAR_COLLEGE where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		yearColleges.addData(data);
    return yearColleges;
  }
  
	public CommonBean findAllYearColleges() {
		CommonBean yearColleges=this.createYearCollege();
		String sql="select * from T_YEAR_COLLEGE ";
		List data=this.getCommonDao().select(sql,new String[]{});
		yearColleges.addData(data);
    return yearColleges;
  }
	public void insertYearCollege(CommonBean yearCollegeBean){
		List data=yearCollegeBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
}

